package com.chaopei.znpk.mapper;


import com.chaopei.znpk.entity.Course;
import javafx.scene.layout.CornerRadii;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* @author 28458
* @description 针对表【course】的数据库操作Mapper
* @createDate 2022-05-18 10:49:47
* @Entity com.chaopei.znpk.entity.Course
*/
@Repository
public interface CourseMapper{
    /**
     * 插入一条课程信息
     * @param course
     * @return
     */
    @Insert("insert into course(id,c_name,credit,type) values(#{id},#{cname},#{credit},#{type})")
    int insertOne(Course course);

    /**
     * 获取所有课程信息
     * @return
     */
    @Select("select id,c_name,credit,type from course")
    List<Course> selectAll();
}




